/**
  ****************************RM Warrior 2023****************************
  * @file       motor_task.c/h
  * @brief      对底盘前进速度和旋转速度控制
	*             电机速度PI环：500HZ
	*             
	*             
  * @note       
  * @history
  *  Version    Date            Author          Modification
  *  V1.0.0     2023/2/         pxx              ......
  *
  @verbatim
  ==============================================================================

  ==============================================================================
  @endverbatim
  ****************************RM Warrior 2023****************************
  */
 
#ifndef 	MOTOR_TASK_H
#define 	MOTOR_TASK_H

#include    "step_motor_gpio.h"
#include 	"jy901.h"
#include    "Gimbal_Task.h"


typedef  struct
{
	int32_t  Motor_1_Location_Now;
	int32_t  Motor_1_Location_Target;
	int32_t  Motor_1_Angle_delta;

	int32_t  Motor_2_Location_Now;
	int32_t  Motor_2_Location_Target;
	int32_t  Motor_2_Angle_delta;
} Locat_msg;







#define     STEP_MOTOR_1_EN               0                  //电机使能信号
#define     STEP_MOTOR_2_EN               0                  //电机使能信号低

#define  	STEP_SPEED                    1                  //1ms   Both_edge  2000*
#define     STEP_ANGLE                    1.8f
#define     RAD_TO_ANGLE                  57.29577951308232088f






#define  	UART_SPEED                    5                  //2ms   500hz   控制/读取速率100hz

#define     PITCH_DANGWEI_TO_REAL_GYRO    13.85041551246537396f
#define     YAW_DANGWEI_TO_REAL_GYRO      13.63512407962912463f

extern void motor_task(void *pvParameters);
const Real_Data* get_pitch_real_point(void);
const Real_Data* get_yaw_real_point(void);
#endif
